#!/bin/sh

SYSTYPE=$(cat /sys/class/dmi/id/sys_vendor | grep -ic vmware)

if [ "$SYSTYPE" -gt 0 ]; then
	# Creates mountpoint for Shared Folders
	if [ ! -d /mnt/hgfs ]; then
		mkdir -p /mnt/hgfs
		# try to mount the root shared folder, this command can fail
		# if shared folders are disabled on the host, vmtoolsd will take care of the mount
		# if they are enabled while the machine is running.
		/usr/local/bin/vmhgfs-fuse -o allow_other .host:/ /mnt/hgfs
	fi

	ln -s /usr/local/bin/lsb_release /usr/bin/lsb_release
	/usr/local/bin/vmtoolsd --background /var/run/vmtoolsd.pid
fi
